define(['app'], function(app) {
	'use strict';

	var controller = function controller($scope, Addsales,  $ionicSlideBoxDelegate) {

		//滑动时候触发
		$scope.selectIndex = 0;
		$scope.slideChanged = function(index) {
			//手指滑动
			$scope.selectIndex = index;
		};
		$scope.activeSlide = function(index) {
			$scope.selectIndex = index;
			$ionicSlideBoxDelegate.$getByHandle('main-handle').slide(index);
		};
		//数据获取
		Addsales.get_detail(function(data) {
			$scope.detail = data;
		});


	}

	controller.$inject = ['$scope', 'Addsales','$ionicSlideBoxDelegate'];

	return app.registerController("addsalesctrl",controller);
});
